package  com.diamond.action;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;

import com.diamond.bo.SuppOrderDetailBO;
import com.diamond.facade.SuppOrderdetailFacade;
import com.diamond.service.ISupporderdetailService;

/**
 * SupplierdetailAction ������
 * @author JSmart Tools
 */
public class SupporddetailAction extends ActionSupport {

	private HttpServletRequest request = ServletActionContext.getRequest();
//	private ISupplierdetailService supplierdetailService;
	private SuppOrderdetailFacade suppOrderdetailFacade;
	private SuppOrderDetailBO supperOrderDetailBo;
	private List dataList;
	private String tips;
	
	public String doSave() {
		try {
			suppOrderdetailFacade.save(supperOrderDetailBo);
			return SUCCESS;
		} catch (Exception e) {
			return ERROR;
		}
	}
 
	public String toUpdate() {
		try {
			supperOrderDetailBo = (SuppOrderDetailBO) suppOrderdetailFacade.findById(request.getParameter("id"));
			return "toUpdate";
		} catch (Exception e) {
			return ERROR;
		}
	}  

	public String doUpdate() {
		try {
			suppOrderdetailFacade.update(supperOrderDetailBo);
			return SUCCESS;
		} catch (Exception e) {
			return ERROR;
		}
	}
   	
	public List getDataList() {
		return dataList;
	}

	public void setDataList(List dataList) {
		this.dataList = dataList;
	}
	
	public SuppOrderDetailBO getSupplierdetailBo() {
		return supperOrderDetailBo;
	}

	public void setSupplierdetailBo(SuppOrderDetailBO supplierdetailBo) {
		this.supperOrderDetailBo = supplierdetailBo;
	}

	public void setSupplierdetailFacade(SuppOrderdetailFacade supplierdetailFacade) {
		this.suppOrderdetailFacade = supplierdetailFacade;
	}

	public SuppOrderDetailBO getSupplierdetail() {
		return supperOrderDetailBo;
	}

	public void setSupplierdetail(SuppOrderDetailBO supplierdetailBo) {
		this.supperOrderDetailBo = supplierdetailBo;
	}
    
	public String getTips() {
		return tips;
	}

	public void setTips(String tips) {
		this.tips = tips;
	}
}
